package com.acwing.lc.part1;

/**
 * @author rkc
 * @date 2022/9/16 16:31
 */
public class LC62不同路径 {

    public int uniquePaths(int n, int m) {
        int[][] f = new int[n + 10][m + 10];
        for (int i = 1; i <= n; i++) f[i][1] = 1;
        for (int j = 1; j <= m; j++) f[1][j] = 1;
        for (int i = 2; i <= n; i++) {
            for (int j = 2; j <= m; j++) {
                f[i][j] = f[i - 1][j] + f[i][j - 1];
            }
        }
        return f[n][m];
    }
}
